package com.wl.day44.dao;

import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import com.wl.day44.model.BookType;

@CacheNamespace
public interface BookTypeDAO {
	@Select("select * from book_type")
	@Results(id="bookTypeMapper", value={
			@Result(id=true,column="type_id", property="typeId"),
			@Result(column="type_name", property="typeName")
			})
	public List<BookType> findAll();
	
	@Select("select * from book_type where type_id = #{typeId}")
	@ResultMap("bookTypeMapper")
	public BookType findById(int typeId);
}
